<template>
  <div class="common-nft-grid">
    <div
      class="nft-grid-item common-section-item select-mode"
      v-for="(item, idx) in dataList"
      @click="clickDetail"
      :key="idx"
    >
      <div class="item-top">
        <div class="avatar" :style="{ background: bgList[idx] }">
          <div class="avatar-inner"></div>
        </div>
        <div class="title"><div class="title-text">添加 NFT</div></div>
      </div>
      <div class="common-item-separation column-mode"></div>
      <div class="item-bottom">
        <div class="title">仓位算力</div>
        <div class="value">
          <div class="value-text">1</div>
          <!---->
        </div>
        <div class="buttons">
          <a class="button-primary">质押</a>
          <a class="outline">升级算力</a>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  props: {},
  data: () => ({
    bgList: [
      "radial-gradient(rgb(173, 238, 255), rgb(38, 179, 255))",
      "radial-gradient(rgb(255, 241, 255), rgb(249, 66, 255)",
      "radial-gradient(rgb(255, 248, 204), rgb(250, 213, 81))",
      "radial-gradient(rgb(199, 255, 240), rgb(18, 226, 138))",
      "radial-gradient(rgb(197, 255, 251), rgb(10, 215, 190))",
      "radial-gradient(rgb(255, 195, 188), rgb(255, 98, 79))",
      "radial-gradient(rgb(255, 214, 179), rgb(243, 145, 61))",
      "radial-gradient(rgb(230, 194, 255), rgb(164, 46, 247))",
    ],
    dataList: [1, 2, 3, 4, 5, 6, 7, 8],
  }),
  methods: {
    clickDetail() {},
  },
};
</script>
<style  lang="scss" scoped>
@import "./../../../common/styles/common.scss";

.common-nft-grid {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  margin: 0 -15px;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  .nft-grid-item {
    min-width: 230px;
    max-width: calc(25% - 30px);
    -webkit-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    margin: 30px 15px 0;
    border-radius: 16px;
    @media screen and (max-width: 1101px) {
      max-width: calc(50% - 30px);
    }
    @media screen and (max-width: 1439px) {
      max-width: calc(33.33333% - 30px);
    }
  }
  .common-section-item {
    background: #fff;
    -webkit-box-shadow: 0 10px 15px -3px rgb(0 0 0 / 3%),
      0 4px 6px -2px rgb(0 0 0 / 1%);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 3%), 0 4px 6px -2px rgb(0 0 0 / 1%);
    position: relative;
    border-radius: 32px;
  }
  .item-top {
    padding-bottom: 2px;
    .avatar {
      position: relative;
      padding-bottom: 100%;
      height: 0;
      border-top-right-radius: 16px;
      border-top-left-radius: 16px;
      background-color: #adeeff;
      overflow: hidden;
    }
    .avatar-inner {
      background-image: url(./../../../assets/images/pool/icon-plus.svg);
      background-size: 50%;
      cursor: pointer;
      background-position: 50%;
      background-repeat: no-repeat;
      left: 0;
      width: 100%;
      height: 100%;
      position: absolute;
      top: 0;
    }
    .title {
      color: #694f4e;
      font-weight: 400;
      margin: 0;
      display: flex;
      -webkit-box-align: center;
      align-items: center;
      height: 68px;
      padding: 0 24px;
      @media screen and (min-width: 300px) and (max-width: 960px) {
        padding: 0 18px !important;
        height: 60px;
      }
      .title-text {
        font-size: 18px;
        line-height: 1.2;
        color: #431216;
        word-break: break-word;
        font-weight: 700;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        @media screen and (min-width: 300px) and (max-width: 960px) {
          font-size: 14px;
        }
      }
    }
  }
  .common-item-separation {
    width: 2px;
    position: relative;
    background-repeat: repeat-y;
    background-size: contain;
    background-position: 50%;
  }
  .column-mode {
    height: 1px;
    width: unset;
    background-image: url(./../../../assets/images/pool/icon-ticket-line-horizontal.svg);
    background-repeat: repeat-x;
  }
  .item-bottom {
    padding: 12px 24px 20px;
    @media screen and (min-width: 300px) and (max-width: 960px) {
      padding: 12px 16px 15px;
    }
    .buttons {
      color: #694f4e;
      font-weight: 400;
      margin: 0;
      padding: 0;
      display: flex;
      -webkit-box-orient: vertical;
      -webkit-box-direction: normal;
      flex-direction: column;
      margin-top: 6px;
    }
    .button-primary {
      margin-top: 10px;
      height: 38px;
      font-size: 14px;
      background: #fad551;
      @include btn();
      @media screen and (min-width: 300px) and (max-width: 960px) {
        height: 32px;
        font-size: 12px;
      }
    }
    .outline {
      @include btn();
      margin-top: 10px;
      border: 1px solid #fad551;
      background: rgba(250, 213, 81, 0.2);
      color: #431216;
      height: 38px;
      font-size: 14px;
      @media screen and (min-width: 300px) and (max-width: 960px) {
        height: 32px;
        font-size: 12px;
      }
    }
    .title {
      font-size: 14px;
      color: #694f4e;
      display: -webkit-box;
      display: -ms-flexbox;
      display: flex;
      -webkit-box-pack: justify;
      -ms-flex-pack: justify;
      justify-content: space-between;
      @media screen and (min-width: 300px) and (max-width: 960px) {
        font-size: 12px !important;
      }
    }
    .value {
      -webkit-box-align: center;
      -ms-flex-align: center;
      align-items: center;
      color: #431216;
      margin-top: 1px;
      display: -webkit-box;
      display: -ms-flexbox;
      display: flex;
      -webkit-box-pack: justify;
      -ms-flex-pack: justify;
      justify-content: space-between;
      .value-text {
        font-size: 22px;
        font-weight: 700;
        @media screen and (min-width: 300px) and (max-width: 960px) {
          font-size: 18px;
        }
      }
    }
  }
}
@media screen and (max-width: 1439px) {
  .common-nft-grid .nft-grid-item {
    max-width: calc(33.33333% - 30px);
  }
}
@media screen and (min-width: 375px) and (max-width: 960px) {
  .common-nft-grid .nft-grid-item {
    min-width: 160px;
    margin: 15px 8px 0;
    max-width: calc(50% - 16px);
  }
}
@media screen and (min-width: 300px) and (max-width: 320px) {
  .common-nft-grid .nft-grid-item {
    min-width: 160px;
    margin: 20px 40px 0;
    max-width: 100%;
  }
}
</style>